import pandas as pd
pd.set_option('display.unicode.east_asian_width',True)
df = pd.read_excel('学生成绩表.xlsx')
df['总成绩'] = df.groupby({'语文':'总成绩','数学':'总成绩','英语':'总成绩','综合':'总成绩'},axis=1).agg('sum')
df['排名'] = df['总成绩'].rank(method='min',ascending=False)
df.sort_values('排名',inplace=True,ignore_index=True)
df1 = pd.DataFrame()
groups = df.groupby('排名')
for group in groups:
    df2 = pd.DataFrame(group[1])
    df2.sort_values('语文',ascending=False,inplace=True)
    df1 = pd.concat([df1,df2])
df1 = df1.reset_index(drop=True)
print(df1)